<template>
  <div class="workTrack">
    <div class="workTrackTop">
      <!-- 搜索表单 -->
      <div class="topForm">
        <el-form ref="searchForm" :model="searchForm" :inline="true" size="mini">
          <el-form-item label="订单号:" prop="orderNum">
            <el-input v-model="searchForm.orderNum" style="width:130px" clearable></el-input>
          </el-form-item>
          <el-form-item label="运单号:" prop="wayBill">
            <el-input v-model="searchForm.wayBill" style="width:130px" clearable></el-input>
          </el-form-item>
          <el-form-item label="运单状态:" prop="wayBillStatus">
            <el-select v-model="searchForm.wayBillStatus" style="width:130px" filterable clearable>
              <el-option v-for="(item, index) in statuList" :key="index" :label="item.rvCmeaning" :value="item.rvLowValue"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="车牌号:" prop="carNum">
            <el-input v-model="searchForm.carNum" style="width:130px" clearable></el-input>
          </el-form-item>
          <el-form-item label="司机:" prop="driver">
            <el-input v-model="searchForm.driver" style="width:130px" clearable></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" size="mini" @click="searchList">查询</el-button>
          </el-form-item>
        </el-form>
      </div>
      <!-- 上方表格 -->
      <div class="topTable">
        <div class="topTableTitle">运单列表</div>
        <!-- 按钮组 -->
        <div class="topTableBtn">
          <buttonName :disabled="buttonDisabled" @clickEvent="clickEventDom"></buttonName>
          <!--          <el-button type="primary" size="mini" plain v-if="isAuth('undoWayBill')" @click="undoWayBill">{{ funcmap['CHX'] }}</el-button>-->
          <!--          <el-button type="primary" size="mini" plain v-if="isAuth('arriveConfirm')" @click="editWillBill('ZHD')">{{ funcmap['ZHD'] }}</el-button>-->
          <!--          <el-button type="primary" size="mini" plain v-if="isAuth('loadCompletion')" @click="wayBillWC('ZH')">{{ funcmap['ZH'] }}</el-button>-->
          <!--          <el-button type="primary" size="mini" plain v-if="isAuth('arriveXhConfirm')" @click="editWillBill('XHD')">{{ funcmap['XHD'] }}</el-button>-->
          <!--          <el-button type="primary" size="mini" plain v-if="isAuth('xhConfirm')" @click="editWillBill('XH')">{{ funcmap['XH'] }}</el-button>-->
          <!--          <el-button type="primary" size="mini" plain v-if="isAuth('wayBillConfirm')" @click="editWillBill('WC')">{{ funcmap['WC'] }}</el-button>-->
        </div>
        <!-- 表格 -->
        <div class="topTableBox" ref="tableBoxRef">
          <el-table
            :data="topTableData"
            border
            ref="topTableRef"
            class="waybillDetermineCss"
            :header-cell-style="{ textAlign: 'center' }"
            highlight-current-row
            :height="topTableHeight"
            @row-click="getTopCurrent"
            @selection-change="handleSelectionChange"
            :ctrlSelect="true"
            :cell-style="cellStyle"
          >
            <el-table-column type="index" :index="indexMethod" align="center" label=" " width="50"></el-table-column>
            <el-table-column align="center" type="selection" width="55"></el-table-column>
            <el-table-column align="center" prop="zjcz" label="运单操作" show-overflow-tooltip width="180">
              <template slot-scope="scope">
                <!-- <el-link type="primary" @click="upload" >单据上传</el-link>&nbsp;&nbsp; -->
                <el-upload id="uploadimage" action :show-file-list="false" :http-request="uploadImage" :before-upload="beforeUpload">
                  <!-- <el-button type="text" >单据上传</el-button> -->
                  <div style="color:#409EFF">单据上传</div>
                </el-upload>
                <el-link type="primary" @click="viewPic(scope.row)">单据查看</el-link>
              </template>
            </el-table-column>

            <el-table-column prop="tayNo" label="订单号" width="200" show-overflow-tooltip sortable></el-table-column>
            <el-table-column prop="waContractNo" label="合同号" width="200" show-overflow-tooltip sortable></el-table-column>
            <el-table-column prop="tayIeflag" label="运单号" width="200" show-overflow-tooltip sortable>
              <template slot-scope="scope">
                <div style="color:#409EFF" @click="JumpMonitor">{{scope.row.tayIeflag}}</div>
              </template>
            </el-table-column>
            <el-table-column prop="tayStates" label="车牌号" width="150" show-overflow-tooltip></el-table-column>
            <el-table-column prop="tdrName" label="司机" width="150" show-overflow-tooltip></el-table-column>
            <el-table-column prop="tayWrkdate" label="司机电话" width="150" align="left" show-overflow-tooltip></el-table-column>
            <el-table-column prop="tayExpensePayable" label="运单状态" width="150" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="wabGoodname" label="货物名称" width="150" align="left" show-overflow-tooltip></el-table-column>
            <el-table-column prop="WAB_WEIGHT" label="货物重量(T)" width="150" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="wabCtrNo" label="箱号" width="150" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="wabSealNo" label="铅封号" width="150" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="wabProBatch" label="生产批次" width="150" align="center" show-overflow-tooltip></el-table-column>
            <!--            <el-table-column prop="WAB_ETC" label="ETC费用" width="110" align="right" show-overflow-tooltip  ></el-table-column>-->
            <!--            <el-table-column prop="WAB_OILCONS" label="油耗费用" width="110" align="right" show-overflow-tooltip  ></el-table-column>-->
            <!--            <el-table-column prop="WAB_POERF" label="运费" align="right" show-overflow-tooltip  ></el-table-column>-->
            <!--            <el-table-column prop="RESUL" label="总和" align="right" show-overflow-tooltip  ></el-table-column>-->
            <el-table-column prop="wcdSttime" label="装货时间" width="180" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="wcdEdtime" label="卸货时间" width="180" align="center" show-overflow-tooltip></el-table-column>
            <!--            <el-table-column prop="tayOprtdate" label="轨迹跟踪" width="180" show-overflow-tooltip sortable ></el-table-column>-->
            <!--            <el-table-column prop="tayOprtdate" label="审核标识" width="110" show-overflow-tooltip sortable ></el-table-column>-->
            <!--            <el-table-column prop="tayOprtdate" label="审核操作人" width="120" show-overflow-tooltip sortable ></el-table-column>-->
            <!--            <el-table-column prop="tayOprtdate" label="审核操作时间" width="130" align="center" show-overflow-tooltip sortable ></el-table-column>-->
            <!--            <el-table-column prop="tayOprtdate" label="备注" show-overflow-tooltip sortable ></el-table-column>-->
          </el-table>

          <!-- 分页 -->
          <div>
            <el-pagination
              class="pagination"
              small
              background
              ref="pagination"
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="Pagination.currentPage"
              :page-sizes="Pagination.pageSizeList"
              :page-size="Pagination.pageSize"
              :layout="Pagination.layout"
              :total="Pagination.total"
            ></el-pagination>
          </div>
        </div>
      </div>
      <!-- 下方表格 -->
      <!--<div class="botTable">-->
      <!--  <div class="botTableTitle">节点动态信息</div>-->
      <!--  <div class="botTableBtn">-->
      <!--    <el-button type="primary" icon="document" size="mini" @click="handleImport" plain>动态批量录入</el-button>-->
      <!--    <el-button plain size="mini" type="primary" @click="dynamicBtn">动态录入</el-button>-->
      <!--    <el-button plain size="mini" type="primary" @click="dynamicEdit('diongBj')">动态编辑</el-button>-->
      <!--    <el-button plain size="mini" type="primary" @click="dynamicDel">动态删除</el-button>-->
      <!--  </div>-->
      <!--  <div class="botTableBox">-->
      <!--    <el-table-->
      <!--      :data="botTableData"-->
      <!--      border-->
      <!--      :height="botTableHeight"-->
      <!--      :header-cell-style="{ textAlign: 'center' }"-->
      <!--      highlight-current-row-->
      <!--      @row-click="mainBotRowClick"-->
      <!--    >-->
      <!--      <el-table-column type="index" align="center" label=" " width="50"></el-table-column>-->
      <!--      &lt;!&ndash;            <el-table-column type="selection"></el-table-column>&ndash;&gt;-->
      <!--      <el-table-column prop="lacOptm" label="作业开始时间" show-overflow-tooltip></el-table-column>-->
      <!--      <el-table-column prop="lacOpendtm" label="作业结束时间" show-overflow-tooltip></el-table-column>-->
      <!--      <el-table-column prop="lacOpprc" label="作业动态" width="110" show-overflow-tooltip></el-table-column>-->
      <!--      <el-table-column prop="lacAddress" label="作业开始地点" show-overflow-tooltip></el-table-column>-->
      <!--      <el-table-column prop="lacEndAddress" label="作业结束地点" show-overflow-tooltip></el-table-column>-->
      <!--      <el-table-column prop="lacShipName" label="船名" show-overflow-tooltip></el-table-column>-->
      <!--      <el-table-column prop="lacVoyage" label="航次" show-overflow-tooltip></el-table-column>-->
      <!--      <el-table-column prop="lacContent" label="内容" show-overflow-tooltip></el-table-column>-->
      <!--      &lt;!&ndash;            <el-table-column prop="lacCreatetm" label="操作时间" show-overflow-tooltip  sortable ></el-table-column>&ndash;&gt;-->
      <!--      &lt;!&ndash;            <el-table-column prop="lacCreater" label="操作员工" width="110" show-overflow-tooltip  sortable ></el-table-column>&ndash;&gt;-->
      <!--      &lt;!&ndash;            <el-table-column prop="lacRemark" label="备注" show-overflow-tooltip  sortable ></el-table-column>&ndash;&gt;-->
      <!--    </el-table>-->
      <!--  </div>-->
      <!--</div>-->
      <!-- region 运单动态（暂时隐藏） -->
      <!--      <div class="botTable">-->
      <!--        <div class="botTableTitle">运单状态</div>-->
      <!--        <div class="botTableBox">-->
      <!--          <el-table :data="botTableData" border :height="botTableHeight" :header-cell-style="{ textAlign: 'center' }" highlight-current-row>-->
      <!--            <el-table-column type="index" align="center" label=" " width="50"></el-table-column>-->
      <!--            <el-table-column prop="tayNo" label="操作状态" align="center" show-overflow-tooltip sortable></el-table-column>-->
      <!--            <el-table-column prop="tayIeflag" label="司机" show-overflow-tooltip sortable ></el-table-column>-->
      <!--            <el-table-column prop="tayStates" label="车牌号" show-overflow-tooltip  sortable ></el-table-column>-->
      <!--            <el-table-column prop="tdrName" label="操作人" show-overflow-tooltip  sortable></el-table-column>-->
      <!--            <el-table-column prop="tayWrkdate" label="操作时间" align="center" show-overflow-tooltip sortable></el-table-column>-->
      <!--            <el-table-column prop="tdrRmark" label="备注" show-overflow-tooltip  sortable></el-table-column>-->
      <!--          </el-table>-->
      <!--        </div>-->
      <!--      </div>-->
      <!-- 对话框 证件上传 查看 -->
      <!--      :width="widthImg"-->
      <!-- endregion -->
      <el-dialog
        width="40%"
        :title="title"
        :visible.sync="openUpload"
        v-if="openUpload"
        v-el-drag-dialog
        :before-close="closeUpload"
        :close-on-click-modal="false"
        append-to-body
      >
        <div class="box" v-if="!pic"></div>
        <!--        <div class="pic"  v-else>-->
        <!--          <br/><img :src='picturePath' style="margin-bottom: inherit" alt="未上传"><br/>-->
        <!--        </div>-->
        <div v-for="item_img in picturePaths" :index="index" :key="item_img.id" style="text-align:center" v-else>
          <span style="font-size: 2.4rem ;color: brown;">{{ picturePaths_status[item_img] }}</span>
          <br />
          <!--          <span style="font-size: 2.4rem ;color: green;"> {{picturePaths_status[item_img]}}</span><br>-->
          <img class="demo-image" :src="item_img" alt="未上传" style="width:470px;height:250px" />
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="closeUpload" size="mini">关闭</el-button>
        </div>
      </el-dialog>
    </div>
    <!--    补录箱号、铅封号、生产批次信息弹框-->
    <el-dialog :title="buluTitle" :visible.sync="buluDialog" v-if="buluDialog" width="25%" style="top: 12vh" :close-on-click-modal="false" v-el-drag-dialog>
      <el-form ref="buluForm" style="text-align: center;" :model="buluForm" :rules="buluRules" :inline="true" size="mini">
        <el-row>
          <el-col :span="18">
            <el-form-item label="运单号:" label-width="80px" prop="wabCode">
              <el-input v-model="buluForm.wabCode" clearable style="width: 206px" maxlength="20"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="18">
            <el-form-item label="箱号:" label-width="80px" prop="wabCtrNo">
              <el-input v-model="buluForm.wabCtrNo" clearable style="width: 206px" maxlength="11"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="18">
            <el-form-item label="铅封号:" label-width="80px" prop="wabSealNo">
              <el-input v-model="buluForm.wabSealNo" clearable style="width: 206px" maxlength="10"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="18">
            <el-form-item label="生产批次:" label-width="80px" prop="wabProBatch">
              <el-input v-model="buluForm.wabProBatch" clearable style="width: 206px"></el-input>
              <!--              <el-date-picker v-model="buluForm.wabProBatch" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>-->
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="buluDialog = false">取消</el-button>
        <el-button size="mini" type="primary" @click="buluSave">保存</el-button>
      </span>
    </el-dialog>
    <!-- 主页下方 服务动态列表动态录入弹窗 -->
    <el-dialog
      :title="dynamicTitle"
      :visible.sync="dynamicDialog"
      v-if="dynamicDialog"
      width="43%"
      style="top: 12vh"
      :close-on-click-modal="false"
      v-el-drag-dialog
    >
      <el-form ref="dynamicForm" :model="dynamicForm" :rules="dynamicRules" label-width="90px" :inline="true" size="mini">
        <el-row>
          <el-col :span="12">
            <el-form-item label="作业动态:" label-width="110px" prop="lacOpprc">
              <el-input v-model="dynamicForm.lacOpprc" clearable style="width: 206px" maxlength="10"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="船名:" label-width="110px" prop="lacShipName">
              <el-input v-model="dynamicForm.lacShipName" clearable style="width: 206px" maxlength="10"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="航次:" label-width="110px" prop="lacVoyage">
              <el-input v-model="dynamicForm.lacVoyage" clearable style="width: 206px" maxlength="10"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="作业开始时间:" label-width="110px" prop="lacOptm">
              <el-date-picker
                v-model="dynamicForm.lacOptm"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                clearable
                placeholder="选择日期"
                :picker-options="startPickerOptions"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="作业结束时间:" label-width="110px" prop="lacOpendtm">
              <el-date-picker
                v-model="dynamicForm.lacOpendtm"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                clearable
                placeholder="选择日期"
                :picker-options="endPickerOptions"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="实际到港时间:" label-width="110px" prop="lacAta">
              <el-date-picker
                v-model="dynamicForm.lacAta"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                clearable
                placeholder="选择日期"
                :picker-options="endPickerOptions"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="放货时间:" label-width="110px" prop="lacDof">
              <el-date-picker
                v-model="dynamicForm.lacDof"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                clearable
                placeholder="选择日期"
                :picker-options="endPickerOptions"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="送货时间:" label-width="110px" prop="lacDod">
              <el-date-picker
                v-model="dynamicForm.lacDod"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                clearable
                placeholder="选择日期"
                :picker-options="endPickerOptions"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="签到数量:" label-width="110px" prop="lacSignNum">
              <el-input v-model="dynamicForm.lacSignNum" clearable style="width: 206px" maxlength="10"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="作业开始地点:" label-width="110px" prop="lacAddress">
              <el-input v-model="dynamicForm.lacAddress" clearable style="width: 450px"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="作业结束地点:" label-width="110px" prop="lacEndAddress">
              <el-input v-model="dynamicForm.lacEndAddress" clearable style="width: 450px"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22">
            <el-form-item label="内容:" label-width="110px" prop="lacContent">
              <el-input type="textarea" v-model="dynamicForm.lacContent" style="width: 500px;"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22">
            <el-form-item label="备注:" label-width="110px" prop="lacRemark">
              <el-input type="textarea" v-model="dynamicForm.lacRemark" style="width: 500px"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="dynamicDialog = false">取消</el-button>
        <el-button size="mini" type="primary" @click="dynamicSave">保存</el-button>
      </span>
    </el-dialog>
    <!-- 节点动态导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :data="upload.data"
        :headers="upload.headers"
        :action="upload.url"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">
          将文件拖到此处，或
          <em>点击上传</em>
        </div>
        <div class="el-upload__tip" slot="tip">
          <!--                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
          <el-link type="info" style="font-size:12px" @click="importDynamicTemplate">下载模板</el-link>
        </div>
        <div class="el-upload__tip" style="color:red" slot="tip">提示：仅允许导入“xls”或“xlsx”格式文件！</div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button @click="upload.open = false">取 消</el-button>
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import bus from '@/utils/bus'
import isAuth from '@/mixins/buttonAuth'
import paginationMixin from '@/mixins/pagination'
import resizeMixin from '@/mixins/resize'
// import { getRefCodesByType } from '../../../request/dropDown'
import {
  getWillBillList,
  editWillBill,
  getWillBillStatus,
  getRefCodesByType,
  theOrderManageBjeidt,
  theOrderManageBcList,
  theOrderManageFwList,
  theOrderManageyxqdel,
  releaseDmandService
} from '@/request/api'
import {
  delNodeDycSer,
  downloadDynamicNodeSer,
  editNodeDycSer,
  getReceiptServer,
  getWabActivitesSer,
  saveNodeDycSer,
  undoWayBill,
  uploadReceiptServer
} from '@/request/waybill/waybillDetermine'
import { getToken } from '@/request/http'
import scrollChange from '@/utils/onscroll'
import VDialog from '@/views/systemManagement/SecondaryManagement/groupUser/dialog'
import buttonName from '@/components/buttonName/button-name'

export default {
  name: 'router.waybillDetermine',
  mixins: [paginationMixin, isAuth, resizeMixin],
  data() {
    return {
      waybillDetermine: true, //是不是运单动态确认页面

      selectAll: [], //选中的所有数据
      selectPC: [], //派车数据
      selectJD: [], //接单数据
      selectZHD: [], //抵达装货点数据
      selectZH: [], //装货完成数据
      selectXHD: [], //抵达卸货点数据
      selectXH: [], //卸货数据
      selectWC: [], //运单完成数据

      buttonDisabled: {}, //控制按钮置灰

      searchForm: {
        orderNum: '', // 订单号
        wayBill: '', // 运单号
        wayBillStatus: '', // 运单状态
        carNum: '', // 车牌号
        driver: '' // 司机
      },

      topTableData: [], // 主页上方表格 表格数据
      topTableHeight: -1, // 主页上方表格 表格高度
      topCurrentData: {}, // 主页上方表格 当前行数据
      botTableData: [], // 主页下方表格 表格数据
      botTableHeight: 300, // 主页下方表格 表格数据
      billNum: '',
      // 下拉框数据
      statuList: [], // 运单状态

      //完单补录信息弹框
      buluDialog: false,
      buluTitle: '', //补录弹框标题
      buluForm: {
        wabCode: '', //运单号
        wabCtrNo: '', //箱号
        wabSealNo: '', //铅封号
        wabProBatch: '' //生产批次
      },
      buluRules: {
        wabCode: [{ required: true, message: '运单号不能为空', trigger: 'change' }],
        wabCtrNo: [
          { required: true, message: '箱号不能为空', trigger: 'blur' },
          // {
          //   pattern: /^[a-zA-Z]{4}[0-9]{7}$/,
          //   message: '请正确输入箱号',
          //   trigger: 'blur'
          // }
        ]
        // wabSealNo: [
        //   { required: true, message: '铅封号不能为空', trigger: 'change' },
        // ],
        // wabProBatch: [
        //   { required: true, message: '生产批次不能为空', trigger: 'change' },
        // ],
      },

      // 节点动态信息 动态录入弹窗
      dynamicDialog: false, // 节点动态信息 动态录入弹窗展示
      dynamicTitle: '', // 节点动态信息 动态录入弹窗标题
      mainBotRowClickData: [], //节点动态信息单击数据
      dynamicForm: {
        lacWabId: '', // 运单ID
        lacOpprc: '', // 作业动态
        lacOptm: '', // 作业开始时间
        lacOpendtm: '', // 作业结束时间
        lacFb: '', // 是否发布
        lacAddress: '', // 作业开始地点
        lacEndAddress: '', // 作业结束地点
        lacShipName: '', // 船名
        lacVoyage: '', // 航次
        lacContent: '', // 内容
        lacRemark: '', // 备注
        lacWabType: '', // 运输类型
        lacAta: '', // 实际到港时间
        lacDof: '', // 放货时间
        lacDod: '', // 送货时间
        lacSignNum: '' // 签到数量
      },
      dynamicRules: {
        lacShipName: [{ required: true, message: '船名不能为空', trigger: 'change' }],
        lacVoyage: [{ required: true, message: '航次不能为空', trigger: 'change' }],
        lacOpprc: [{ required: true, message: '作业动态不能为空', trigger: 'change' }],
        lacOptm: [{ required: true, message: '作业开始时间不能为空', trigger: 'blur' }],
        lacOpendtm: [{ required: true, message: '作业结束时间不能为空', trigger: 'blur' }],
        lacFb: [{ required: true, message: '是否发布不能为空', trigger: 'change' }],
        lacAddress: [{ required: true, message: '作业开始地点不能为空', trigger: 'blur' }],
        lacEndAddress: [{ required: true, message: '作业结束地点不能为空', trigger: 'blur' }]
      },
      //上传、查看图片对话框
      openUpload: false,
      // widthImg:'100%',
      picturePath: '',
      picturePaths: [],
      picturePaths_status: {},
      funcmap: {
        CHX: '撤销运单',
        ZHD: '抵达装货确认',
        ZH: '装货完成确认',
        XHD: '抵达卸货确认',
        XH: '卸货完成确认',
        WC: '运单完成确认'
      },
      allowMap: {
        ZHD: {
          status: ['PC'],
          message: '运单状态不是派车状态，无法进行抵达装货确认'
        },
        ZH: {
          status: ['ZHD','PC','JD'],
          message: '运单状态不是抵达装货点状态，无法进行装货完成确认'
        },
        XHD: {
          status: ['ZH'],
          message: '运单状态不是装货状态，无法进行抵达卸货确认'
        },
        XH: {
          status: ['XHD','ZH'],
          message: '运单状态不是抵达卸货确认，无法进行卸货完成确认'
        },
        WC: {
          status: ['XH'],
          message: '运单状态不是卸货状态，无法进行运单完成确认'
        }
      },
      // 节点动态导入参数
      upload: {
        // 是否显示弹出层（节点动态导入）
        open: false,
        // 弹出层标题（节点动态导入）
        title: '',
        data: '',
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的节点动态导入数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Token: getToken() },
        // 上传的地址
        url: (process.env.NODE_ENV === 'production' ? '/' : '/proxy/') + 'FTKJWLHYPT/frtOrder/importDynamicNode'
      }
    }
  },
  mounted() {
    bus.$on('wayBillNum', item => {
      bus.wayBill = item
    })
    this.searchForm.wayBill = bus.wayBill
    this.searchList()
    this.getSelectData()
    let demandWrapper = document.querySelector('.waybillDetermineCss .el-table__body-wrapper')
    // 新增滚动条监听事件
    scrollChange(demandWrapper)
  },
  created() {
    this.resize = () => {
      this.topTableHeight = this.$refs.tableBoxRef.offsetHeight
    }
    this.buttonDisabledM()
  },
  beforeDestroy() {
    bus.$off('wayBillNum')
  },
  methods: {
    JumpMonitor(){
      this.$router.push('/layout/capacityManage/twoCapacityManage/capacityMonitor')
    },
    cellStyle({ row, column, rowIndex, columnIndex }) {
      if (!this.waybillDetermine) {
        return ''
      }
      if (column.label == '运单状态') {
        if (row.tayExpensePayable == '派车') {
          return 'background: #ff6e6c'
        } else if (row.tayExpensePayable == '抵达装货点') {
          return 'background: #0d6fba'
        } else if (row.tayExpensePayable == '装货') {
          return 'background: #0cc2cd'
        } else if (row.tayExpensePayable == '抵达卸货点') {
          return 'background: #2bbf5b'
        } else if (row.tayExpensePayable == '卸货') {
          return 'background: #ffc626'
        } else if (row.tayExpensePayable == '完成') {
          return 'background: #946ce9'
        }
      } else {
        return ''
      }
    },
    clickEventDom(item) {
      if (item.mdlCode === 'undoWayBill') {
        this.undoWayBill()
      } 
      // else if (item.mdlCode === 'arriveConfirm') {
      //   this.editWillBill('ZHD')
      // } 
      else if (item.mdlCode === 'loadCompletion') {
        // this.wayBillWC('ZH')
        this.buluSave()
      } 
      // else if (item.mdlCode === 'arriveXhConfirm') {
      //   this.editWillBill('XHD')
      // } 
      else if (item.mdlCode === 'xhConfirm') {
        this.editWillBill('XH')
      } else if (item.mdlCode === 'wayBillConfirm') {
        this.editWillBill('WC')
      }
    },
    buttonDisabledM() {
      const map = new Map()
      this.$store.getters['user/GET_NAV_BUTTON'].moduleChildrenGrand.forEach(m => {
        if (this.selectAll.length == this.selectPC.length) {
          if (m.mdlCode === 'loadCompletion' || m.mdlCode === 'undoWayBill') {
            map.set(m.mdlCode, false)
          } else {
            map.set(m.mdlCode, true)
          }
        } else if (this.selectAll.length == this.selectJD.length) {
          if (m.mdlCode === 'loadCompletion') {
            map.set(m.mdlCode, false)
          } else {
            map.set(m.mdlCode, true)
          }
        } else if (this.selectAll.length == this.selectZHD.length) {
          if (m.mdlCode === 'loadCompletion') {
            map.set(m.mdlCode, false)
          } else {
            map.set(m.mdlCode, true)
          }
        } 
        else if (this.selectAll.length == this.selectPC.length) {
          if (m.mdlCode === 'loadCompletion') {
            map.set(m.mdlCode, false)
          } else {
            map.set(m.mdlCode, true)
          }
        } 
        else if (this.selectAll.length == this.selectZH.length) {
          if (m.mdlCode === 'xhConfirm') {
            map.set(m.mdlCode, false)
          } else {
            map.set(m.mdlCode, true)
          }
        } else if (this.selectAll.length == this.selectXHD.length) {
          if (m.mdlCode === 'xhConfirm') {
            map.set(m.mdlCode, false)
          } else {
            map.set(m.mdlCode, true)
          }
        } else if (this.selectAll.length == this.selectXH.length) {
          if (m.mdlCode === 'wayBillConfirm') {
            map.set(m.mdlCode, false)
          } else {
            map.set(m.mdlCode, true)
          }
        } else {
          map.set(m.mdlCode, true)
        }
        if (this.selectAll.length == 0) {
          map.set(m.mdlCode, true)
        }
        // if (m.mdlCode === 'loadCompletion') {
        //   if (this.topCurrentData.wabStatus == 'ZHD') {
        //     map.set(m.mdlCode, false)
        //   } else {
        //     map.set(m.mdlCode, true)
        //   }
        // }
      })
      this.buttonDisabled = map
    },
    //选择的数据
    handleSelectionChange(val) {
      ;(this.selectAll = []), //选中的所有数据
        (this.selectPC = []), //派车数据
        (this.selectJD = []), //接单数据
        (this.selectZHD = []), //抵达装货点数据
        (this.selectZH = []), //装货完成数据
        (this.selectXHD = []), //抵达卸货点数据
        (this.selectXH = []), //卸货数据
        (this.selectWC = []) //运单完成数据
      if (val.length > 0) {
        for (var i = 0; i < val.length; i++) {
          this.selectAll.push(val[i])
          if (val[i].wabStatus == 'PC') {
            this.selectPC.push(val[i])
          } else if (val[i].wabStatus == 'JD') {
            this.selectJD.push(val[i])
          } else if (val[i].wabStatus == 'ZHD') {
            this.selectZHD.push(val[i])
          } else if (val[i].wabStatus == 'ZH') {
            this.selectZH.push(val[i])
          } else if (val[i].wabStatus == 'XHD') {
            this.selectXHD.push(val[i])
          } else if (val[i].wabStatus == 'XH') {
            this.selectXH.push(val[i])
          } else if (val[i].wabStatus == 'WC') {
            this.selectWC.push(val[i])
          }
        }
      }
      this.buttonDisabledM()
    },

    // 图片上传之前的检查
    beforeUpload(file) {
      if (file.type.indexOf('image') === -1) {
        this.$message.error({
          message: '请上传正确的图片类型',
          showClose: true
        })
        return false
      }
    },
    //上传图片
    uploadImage({ file }) {
      setTimeout(() => {
        uploadReceiptServer({ file, wabUuid: this.topCurrentData.uuid }).then(() => {
          this.$message({
            type: 'success',
            message: '单据上传成功！'
          })
        })
      }, 300)
      setTimeout(() => {
        this.searchList()
      }, 400)
    },
    //证件查看
    viewPic(row) {
      getReceiptServer({
        wattcWabId: row.uuid
      }).then(res => {
        this.picturePaths = res.data.map(item => api.IMAGE_PREFIX + item.wattcImgUrl)
        // this.picturePaths = res.data.map(item => 'http://db.winjoinit.com:20104/' + item.wattcImgUrl)
        res.data.forEach(p => {
          this.$set(this.picturePaths_status, api.IMAGE_PREFIX + p.wattcImgUrl, p.wattcWabStatusName)
        })
      })
      setTimeout(() => {
        this.picturePath = api.IMAGE_PREFIX + this.picturePaths
        // this.picturePath = 'http://db.winjoinit.com:20104/FTKJHYPT/img/20200620/1592645623653_577.png'
        this.openUpload = true
        this.title = '查看'
        this.pic = true
      }, 600)
      // this.widthImg = "29%"
    },
    //关闭上传对话框
    closeUpload() {
      this.openUpload = false
    },
    //撤销运单
    undoWayBill() {
      let t = this
      if (t.selectAll.length != 0) {
        if (t.selectJD != 0) {
          t.$message.error('该运单已被司机接单，不允许撤销！')
          return
        }
        if (t.selectZHD != 0) {
          t.$message.error('该运单已抵达装货点，不允许撤销！')
          return
        }
        if (t.selectZH != 0) {
          t.$message.error('该运单已装货完成，不允许撤销！')
          return
        }
        if (t.selectXHD != 0) {
          t.$message.error('该运单已抵达卸货点，不允许撤销！')
          return
        }
        if (t.selectXH != 0) {
          t.$message.error('该运单已卸货完成，不允许撤销！')
          return
        }
        if (t.selectWC != 0) {
          t.$message.error('该运单已完成，不允许撤销！')
          return
        }
        this.$confirm('您确认要将所选定的' + t.selectPC.length + '条运单撤销吗?', '提示', {
          closeOnClickModal: false
        }).then(() => {
          let li = t.selectPC
          li.forEach(item => {
            undoWayBill({
              waybill: item
            })
              .then(() => {
                // this.$message.success(this.funcmap['CHX'] + '成功！')
              })
              .finally(() => {
                this.topCurrentData = {}
                this.botTableData = []
                this.searchList()
              })
          })
          this.$message({
            message: '撤销成功！',
            type: 'success',
            showClose: true
          })
        })
      } else {
        t.$message.error('请勾选至少一条运单数据')
      }
      // if(Object.keys(this.topCurrentData).length == 0) {
      //   this.$alert('请选择一条数据','提示',{
      //     confirmButtonText: '确定'
      //   })
      //   return
      // }
      // if (this.topCurrentData.wabStatus != 'PC') {
      //   this.$alert('已接单的运单不可撤销','提示',{
      //     confirmButtonText: '确定'
      //   })
      //   return
      // }
      // undoWayBill({
      //   waybill:this.topCurrentData
      // }).then(() => {
      //   this.$message.success(this.funcmap['CHX'] + '成功！')
      // }).finally(() => {
      //   this.topCurrentData = {}
      //   this.botTableData = []
      //   this.searchList()
      // })
    },
    wayBillWC(status) {
      if (Object.keys(this.topCurrentData).length == 0) {
        this.$alert('请先选择一条数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (!this.allowMap[status].status.includes(this.topCurrentData.wabStatus)) {
        this.$alert(this.allowMap[status].message, '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      ;(this.buluForm = {
        wabCode: this.topCurrentData.tayIeflag,
        wabCtrNo: this.topCurrentData.wabCtrNo,
        wabSealNo: this.topCurrentData.wabSealNo,
        wabProBatch: this.topCurrentData.wabProBatch
      }),
        (this.buluTitle = '完单补录')
      this.buluDialog = true
    },
    buluSave() {
      if (Object.keys(this.topCurrentData).length == 0) {
        this.$alert('请先选择一条数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.buluForm = {
        wabCode: this.topCurrentData.tayIeflag,
        wabCtrNo: this.topCurrentData.wabCtrNo,
        wabSealNo: this.topCurrentData.wabSealNo,
        wabProBatch: this.topCurrentData.wabProBatch
      }
      editWillBill({
        uuid: this.topCurrentData.uuid,
        attUuid: this.topCurrentData.attUuid,
        wabStatus: 'ZH',
        wabCode: this.buluForm.wabCode,
        attCode: this.topCurrentData.tayNo,
        wabUuid: this.topCurrentData.wabUuid,
        wabCtrNo: this.buluForm.wabCtrNo,
        wabSealNo: this.buluForm.wabSealNo,
        wabProBatch: this.buluForm.wabProBatch
      })
        .then(() => {
          this.$message.success(this.funcmap['ZH'] + '成功！')
        })
        .finally(() => {
          this.topCurrentData = {}
          this.botTableData = []
          this.buluDialog = false
          this.searchList()
        })
    },
    //编辑运单
    editWillBill(status) {
      let t = this
      if (t.selectAll.length != 0) {
        // if (status === 'ZHD') {
        //   if (t.selectAll.length != t.selectPC.length + t.selectJD.length) {
        //     t.$message.error('存在不是派车状态的运单，无法进行抵达装货确认')
        //     return
        //   }
        // }
        if (status === 'ZH') {
          if (t.selectAll.length != t.selectZHD.length&&t.selectAll.length != t.selectPC.length + t.selectJD.length) {
            t.$message.error('存在不符合装货状态的运单，无法进行装货完成确认')
            return
          }
        }
        // if (status === 'XHD') {
        //   if (t.selectAll.length != t.selectZH.length) {
        //     t.$message.error('存在不是装货完成状态的运单，无法进行抵达卸货点确认')
        //     return
        //   }
        // }
        if (status === 'XH') {
          if (t.selectAll.length != t.selectXHD.length&&t.selectAll.length != t.selectZH.length) {
            t.$message.error('存在不符合卸货状态的运单，无法进行卸货完成确认')
            return
          }
        }
        if (status === 'WC') {
          if (t.selectAll.length != t.selectXH.length) {
            t.$message.error('存在不是卸货完成状态的运单，无法进行运单完成确认')
            return
          }
        }
        this.$confirm('您确认要将所选定的' + t.selectAll.length + '条运单进行' + this.funcmap[status] + '吗?', '提示', {
          closeOnClickModal: false
        }).then(() => {
          let li = t.selectAll
          li.forEach(item => {
            editWillBill({
              uuid: item.uuid,
              attUuid: item.attUuid,
              wabStatus: status,
              wabCode: item.tayIeflag,
              attCode: item.tayNo,
              wabUuid: item.wabUuid
            })
              .then(() => {
                // this.$message.success(this.funcmap[status] + '成功！')
              })
              .finally(() => {
                this.topCurrentData = {}
                this.botTableData = []
                this.searchList()
              })
          })
          this.$message.success(this.funcmap[status] + '成功！')
        })
      } else {
        t.$message.error('请勾选至少一条运单数据')
      }
      // if(Object.keys(this.topCurrentData).length == 0) {
      //   this.$alert('请选择一条数据','提示',{
      //     confirmButtonText: '确定'
      //   })
      //   return
      // }
      // if (status == this.topCurrentData.wabStatus) {
      //   this.$alert(this.allowMap[status].message,'提示',{
      //     confirmButtonText: '确定'
      //   })
      //   return
      // }

      //跳过接单
      // if (status == 'ZHD') {
      //   this.topCurrentData.wabStatus = 'PC'
      // }
      // if (!this.allowMap[status].status.includes(this.topCurrentData.wabStatus)) {
      //   this.$alert(this.allowMap[status].message,'提示',{
      //     confirmButtonText: '确定'
      //   })
      //   return
      // }
      // editWillBill({
      //   uuid: this.topCurrentData.uuid,
      //   attUuid: this.topCurrentData.attUuid,
      //   wabStatus: status,
      //   wabCode: this.topCurrentData.tayIeflag,
      //   attCode: this.topCurrentData.tayNo,
      //   wabUuid: this.topCurrentData.wabUuid
      // }).then(() => {
      //   this.$message.success(this.funcmap[status] + '成功！')
      // }).finally(() => {
      //   this.topCurrentData = {}
      //   this.botTableData = []
      //   this.searchList()
      // })
    },
    getList(currentPage, pageSize, updateTotal) {
      getWillBillList({
        orderCode: this.searchForm.orderNum,
        billCode: this.searchForm.wayBill,
        billStatus: this.searchForm.wayBillStatus,
        trkCode: this.searchForm.carNum,
        driver: this.searchForm.driver,
        PageIndex: this.Pagination.currentPage,
        PageSize: this.Pagination.pageSize,
        wabType: 'RO'
      }).then(res => {
        this.topTableData = res.data.map(item => {
          return {
            waContractNo: item.waContractNo,
            wabStatus: item.wabStatus,
            attUuid: item.attUuid,
            wabUuid: item.uuid,
            uuid: item.uuid,
            tayNo: item.attCode,
            tayIeflag: item.wabCode,
            tayStates: item.trkNo,
            tdrName: item.dvrName,
            tayWrkdate: item.dvrCtctel,
            tayExpensePayable: item.wabStatusName,
            wabGoodsId: item.wabGoodsId,
            wabGoodname: item.wabGoodname,
            WAB_WEIGHT: item.wabWeight,
            WAB_ETC: item.wabEtc || 0,
            WAB_OILCONS: item.wabOilcons || 0,
            WAB_POERF: item.wabPoerf || 0,
            RESUL: item.resul || 0,
            wcdSttime: item.wcdSttime,
            wcdEdtime: item.wcdEdtime,
            picturePath: item.picturePath,
            wabCtrNo: item.wabCtrNo,
            wabSealNo: item.wabSealNo,
            wabProBatch: item.wabProBatch
          }
        })
        updateTotal(res.total)
      })
      this.topCurrentData = {}
      this.buttonDisabledM()
    },
    // 获取主页上方表格  当前行数据
    getTopCurrent(row) {
      console.log(this.topTableHeight)
      this.topCurrentData = row
      this.buttonDisabledM()
      console.log(this.topCurrentData, 'sssssssssss')
      this.upload.data = {
        wabId: this.topCurrentData.uuid
      }
      // getWabActivitesSer({
      //   wabUuid: this.topCurrentData.uuid
      // }).then(res => {
      //   this.botTableData = res.data
      // })
    },
    // 获取下拉框接口  所有下拉框接口写在这
    getSelectData() {
      getRefCodesByType('网络平台运单状态').then(res => {
        this.statuList = res.data
      })
    },
    // 主页  下方表格  服务动态列表 动态录入按钮
    dynamicBtn() {
      if (Object.keys(this.topCurrentData).length == 0) {
        this.$alert('请先选择一条运单！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.dynamicTitle = '动态录入'
      this.dynamicDialog = true
      this.diongBj = ''
      this.dynamicForm = {
        lacWabId: '', // 运单ID
        lacOpprc: '', // 作业动态
        lacOptm: '', // 作业开始时间
        lacOpendtm: '', // 作业结束时间
        lacFb: '', // 是否发布
        lacAddress: '', // 作业开始地点
        lacEndAddress: '', // 作业结束地点
        lacShipName: '', // 船名
        lacVoyage: '', // 航次
        lacContent: '', // 内容
        lacRemark: '', // 备注
        lacWabType: '' // 运输类型
      }
    },
    // 主页  下方表格  运单节点动态列表 动态编辑按钮
    dynamicEdit() {
      if (Object.keys(this.mainBotRowClickData).length == 0) {
        this.$alert('请先选择需要编辑的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.mainBotRowClickData.lacWabType != 'HY') {
        this.$alert('非海运信息不允许编辑！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      // if(this.mainBotRowClickADataA.length > 1){
      //   this.$alert('每次只能修改一行数据！', '提示', {
      //     confirmButtonText: '确定'
      //   })
      //   return
      // }
      this.dynamicTitle = '动态编辑'
      this.dynamicDialog = true
      this.diongBj = 'A'
      this.dynamicForm.lacOpprc = this.mainBotRowClickData.lacOpprc
      this.dynamicForm.lacOptm = this.mainBotRowClickData.lacOptm
      this.dynamicForm.lacOpendtm = this.mainBotRowClickData.lacOpendtm
      this.dynamicForm.lacFb = this.mainBotRowClickData.lacFb
      this.dynamicForm.lacAddress = this.mainBotRowClickData.lacAddress
      this.dynamicForm.lacEndAddress = this.mainBotRowClickData.lacEndAddress
      this.dynamicForm.lacContent = this.mainBotRowClickData.lacContent
      this.dynamicForm.lacShipName = this.mainBotRowClickData.lacShipName
      this.dynamicForm.lacVoyage = this.mainBotRowClickData.lacVoyage
      this.dynamicForm.lacRemark = this.mainBotRowClickData.lacRemark
    },
    //动态删除
    dynamicDel() {
      if (Object.keys(this.mainBotRowClickData).length == 0) {
        this.$alert('请先选择需要删除的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if (this.mainBotRowClickData.lacWabType != 'HY') {
        this.$alert('非海运信息不允许删除！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.$alert('您确认要删除此节点动态吗？', '提示', {
        confirmButtonText: '确定'
      }).then(() => {
        delNodeDycSer({ lacId: this.mainBotRowClickData.lacId }).then(() => {
          this.$message({
            type: 'success',
            message: '删除成功'
          })
          this.itemC()
        })
      })
    },
    //动态录入点击保存
    dynamicSave() {
      this.$refs.dynamicForm.validate(valid => {
        if (valid) {
          if (this.diongBj == 'A') {
            let typeData = Object.assign(
              {
                lacId: this.mainBotRowClickData.lacId,
                lacWabId: this.topCurrentData.uuid
              },
              this.dynamicForm
            )
            editNodeDycSer(typeData).then(() => {
              this.$message({
                type: 'success',
                message: '编辑成功'
              })
              this.dynamicDialog = false
              this.itemC()
            })
          } else {
            this.dynamicForm.lacWabId = this.topCurrentData.uuid
            saveNodeDycSer(this.dynamicForm).then(() => {
              this.$message({
                type: 'success',
                message: '添加成功'
              })
              this.dynamicDialog = false
              this.itemC()
            })
          }
        }
      })
    },
    //下方节点动态信息表格当前行
    mainBotRowClick(row) {
      this.mainBotRowClickData = row
    },
    //请求下半部分 运单节点动态信息
    itemC() {
      getWabActivitesSer({
        wabUuid: this.topCurrentData.uuid
      }).then(res => {
        this.botTableData = res.data
      })
    },
    /** 导入按钮操作 */
    handleImport() {
      if (Object.keys(this.topCurrentData).length == 0) {
        this.$alert('请先选择一条运单！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.upload.title = '批量动态导入'
      this.upload.open = true
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false
      this.upload.isUploading = false
      this.$refs.upload.clearFiles()
      this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
      this.getList()
      this.itemC()
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit()
    },

    removeFile() {
      this.dialogForm.cteFilePath = null
    },
    importDynamicTemplate() {
      // let url_post = Vue.prototype.api.apiList.EXPORT_BILL;
      //
      // let params_post = {
      //   orderStartDate: this.timepickerDateFormat(this.rangeTime[0]) || this.rangeTime[0] || '',
      //   orderEndDate: this.timepickerDateFormat(this.rangeTime[1]) || this.rangeTime[1] || '',
      //   prodCode: this.prodId,
      //   promoteFlag: this.promotionSiteId,
      //   policyStatusList: this.tableBillStateCheckedData,
      // };
      //
      // Vue.axios.post(url_post,params_post,{responseType: 'arraybuffer'}).then((res) => {
      //
      //   let fileName = res.headers['content-disposition'].match(/fushun(\S*)xls/)[0];
      //
      //   fileDownload(res.data,fileName);  //如果用方法一 ，这里需要安装 npm install js-file-download --save ,然后引用 var fileDownload = require('js-file-download')，使用详情见github;
      //   // let blob = new Blob([res.data], {type: "application/vnd.ms-excel"});
      //
      //   // let objectUrl = URL.createObjectURL(blob);
      //
      //   // window.location.href = objectUrl;
      //
      // }).catch(function (res) {}); },
      downloadDynamicNodeSer()
        .then(res => {
          console.log(res, 'res')
          // 下载文件
          const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.ms-excel' }))
          const link = document.createElement('a') // 创建a标签
          link.download = fileName // a标签添加属性
          link.style.display = 'none'
          link.href = url
          // parseTime(new Date()) + '-' +
          const fileName = '节点动态模板' + '.' + 'xlsx'
          link.setAttribute('download', fileName)
          document.body.appendChild(link)
          link.click()
          URL.revokeObjectURL(link.href) // 释放URL 对象
          document.body.removeChild(link)
        })
        .catch(error => {
          console.log(error, 'error')
        })
    }
  },
  computed: {
    startPickerOptions() {
      return {
        disabledDate: date => {
          // 设置可选择的日期为今天之后的一个月内
          // let curDate = (new Date()).getTime()
          // // 这里算出一个月的毫秒数,这里使用30的平均值,实际中应根据具体的每个月有多少天计算
          // let day = 30 * 24 * 3600 * 1000
          // let dateRegion = curDate + day
          // return date.getTime() < Date.now() - 8.64e7
          // || date.getTime() > dateRegion
          // 设置选择的日期小于当前的日期,小于返回true,日期不可选
          // return time.getTime() < Date.now() - 8.64e7

          if (!this.dynamicForm.lacOpendtm) return false
          return date.getTime() > new Date(this.dynamicForm.lacOpendtm).getTime()
        }
      }
    },
    endPickerOptions() {
      return {
        disabledDate: date => {
          if (!this.dynamicForm.lacOptm) return false
          return date.getTime() < new Date(this.dynamicForm.lacOptm).getTime()
        }
      }
    }
  },
  components: {
    buttonName
  }
}
</script>
<style lang="scss" scoped>
::v-deep .el-table .cell.el-tooltip {
  display: flex;
  justify-content: space-evenly;
}
.workTrack {
  height: calc(100% - 7rem);
  padding: 20px 10px;
  .workTrackTop {
    height: 100%;
    .topForm {
      padding-left: 10px;
      padding-top: 10px;
    }
    .topTable {
      height: 100%;
      .topTableTitle {
        font-weight: bold;
        padding-left: 10px;
      }
      .topTableBox {
        height: calc(100% - 8.5rem);
      }
      .topTableBtn {
        padding-left: 15px;
        margin: 10px 0;
      }
      .block {
        padding-top: 5px;
        margin-bottom: 10px;
      }
    }
    .botTable {
      .botTableTitle {
        font-weight: bold;
        padding-left: 10px;
        margin-bottom: 10px;
      }
      .botTableBtn {
        padding-left: 15px;
        margin: 10px 0;
      }
    }
  }
}
.pic {
  text-align: center;
}
</style>
